<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%request.setAttribute("ctx", request.getContextPath());%>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/css/theme.blue.css" type="text/css"></link>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.validate.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/my.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.tablesorter.js"></script>
    <script type="text/javascript">
        /*js代码区*/
    </script>
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="col-md-12">
    <div class="page-header">
        <h2>
            <small>页面说明</small><br>
        </h2>
    </div>
    ${kclist}
    <div class="col-md-12">

        <table id="myTable" class="tablesorter-blue">
            <%--表头部分--%>
            <thead>
            <tr>
                <td>课程ID</td>
                <td>课程名称</td>
                <td>教师姓名</td>
                <td>课程时间</td>
                <td>课程地点</td>
                <td>操作</td>
            </tr>
            </thead>

            <%--表格内容部分--%>
            <c:forEach items="${kclist}" var="l" varStatus="o">
                <tr>
                    <td>${o.index+1}</td>
                    <td>${l.kcName}</td>
                    <td>${l.teacher}</td>
                    <td>${l.time}</td>
                    <td>${l.address}</td>
                    <td>
                        <input type="button" value="退选" onclick="deleteById(${l.kcId})">
                    </td>
                </tr>
            </c:forEach>
        </table>

    </div>
</div>
</body>
<script type="text/javascript">
    $("#myTable").tablesorter()
    function deleteById(kcId){
        $.post("/kccheck/deleteByid?kcId="+kcId,function (result){

                alert("退课成功");
                location.href="/kc/list";

        },"text")
    }
</script>
</html>